﻿using NoteBook_Shared.Contact;
using NoteBook_Shared.Dtos;
using NoteBook_Shared.Parameters;

namespace NoteBook_Product.Services
{
    public class ToDoService : BaseService<ToDoDto>, IToDoService
    {
        public ToDoService(HttpRestClient client) : base(client, "ToDo")
        {

        }

        public async Task<ApiResponse<PagedList<ToDoDto>>> GetAllFilterAsync(ToDoParameter parameter)
        {
            BaseRequest request = new();
            request.Method = RestSharp.Method.GET;
            request.Rotue = $"api/ToDo/GetAll?pageIndex={parameter.PageIndex}&pageSize={parameter.PageSize}&search={parameter.Search}&status={parameter.Status}";
            return await _client.ExecuteAsync<PagedList<ToDoDto>>(request);
        }
    }
}
